package Bank;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class JBDC {
	static Connection con = null;
	static Statement stmt=null;
	static void open(){
		try {
			Class.forName("oracle.jdbc.OracleDriver");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		
		try {
			con = DriverManager.getConnection(
					"jdbc:oracle:thin:@localhost:1521:XE", "hr", "123456");
			stmt=con.createStatement();
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	static void close(){
		try {
			stmt.close();
			con.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	} 
  public static void main(String[] args) {
	    open();
	    close();				
		
	}
}
